#pragma once

#include "primitive.h"

class sphere: public primitive
{
public:

	point center;
	double radius;

	sphere();
	sphere(point cen, double rad,const char* _name);
	sphere(point cen, double rad);
	sphere(point cen);
	sphere(point cen, point surface, const char* _name);
	sphere(point cen, point sufrace);
	~sphere();

	void getSphereFromXML(std::ifstream &file);

	void setCenter(point cen);
	void setRadius(double rad);
	void setCenterRadius(point cen, double rad);
	void copySphere(sphere TheOneToCopyFrom);
	point getCenter();
	double getRadius();
	//material getMaterial();
	double getSurfaceArea();
	double getVolume();
	double maxX();
	double minX();
	double maxY();
	double minY();
	double maxZ();
	double minZ();

	int intersect( ray& Ray, intersection& inter);
	bool isInShade( ray& Ray);

	vector3 getNormal(point inPoint);

	void getTextureCoords(intersection& inter);


};